package felix.things.router.mqtt.server.common.session;

import io.netty.channel.Channel;
import io.netty.handler.codec.mqtt.MqttPublishMessage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 会话存储
 *
 * @author Felix
 * @date 2019/8/21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SessionStore implements Serializable {

    private static final long serialVersionUID = 5209539791996944490L;

    private String brokerId;

    private String clientId;

    private String channelId;

    private int expire;

    private boolean cleanSession;

    private MqttPublishMessage willMessage;

    public SessionStore(String brokerId, String clientId, String channelId, boolean cleanSession, MqttPublishMessage willMessage, int expire) {
        this.brokerId = brokerId;
        this.clientId = clientId;
        this.channelId = channelId;
        this.cleanSession = cleanSession;
        this.willMessage = willMessage;
        this.expire = expire;
    }
}
